package com.example.module.custom.bean;

import android.text.TextUtils;

import com.contrarywind.interfaces.IPickerViewData;

import java.util.List;

/**
 * @name BlockDemo
 * @class name：com.example.module.custom.bean
 * @classdescribe
 * @anthor ljp
 * @time 2020/2/26 15:21
 */
public class PlanBean {


    /**
     * msg : 请求成功!
     * code : 200
     * dataList : [{"planSource":"MES","dayPlanID":"CRJH20200121-010","oid":"159"},{"planSource":"MES","dayPlanID":"CRJH20200121-009","oid":"158"},{"planSource":"MES","dayPlanID":"CRJH20200121-008","oid":"157"},{"planSource":"MES","dayPlanID":"CRJH20200121-007","oid":"156"},{"planSource":"MES","dayPlanID":"CRJH20200121-006","oid":"155"},{"planSource":"MES","dayPlanID":"CRJH20200121-005","oid":"154"},{"planSource":"MES","dayPlanID":"CRJH20200121-004","oid":"153"},{"planSource":"MES","dayPlanID":"CRJH20200121-003","oid":"152"},{"planSource":"MES","dayPlanID":"CRJH20200121-002","oid":"151"},{"planSource":"MES","dayPlanID":"CRJH20200121-001","oid":"150"},{"planSource":"MES","dayPlanID":"CRJH20200120-014","oid":"149"},{"planSource":"MES","dayPlanID":"CRJH20200120-013","oid":"148"},{"planSource":"MES","dayPlanID":"CRJH20200120-012","oid":"147"},{"planSource":"MES","dayPlanID":"CRJH20200120-011","oid":"146"},{"planSource":"MES","dayPlanID":"CRJH20200120-010","oid":"145"},{"planSource":"MES","dayPlanID":"CRJH20200120-009","oid":"144"},{"planSource":"MES","dayPlanID":"CRJH20200120-008","oid":"143"},{"planSource":"MES","dayPlanID":"CRJH20200120-007","oid":"142"},{"planSource":"MES","dayPlanID":"CRJH20200120-006","oid":"141"},{"planSource":"MES","dayPlanID":"CRJH20200120-005","oid":"140"},{"planSource":"MES","dayPlanID":"CRJH20200120-004","oid":"139"},{"planSource":"MES","dayPlanID":"CRJH20200120-003","oid":"138"},{"planSource":"MES","dayPlanID":"CRJH20200120-002","oid":"137"},{"planSource":"MES","dayPlanID":"CRJH20200120-001","oid":"136"},{"planSource":"MES","dayPlanID":"CRJH20200119-002","oid":"135"},{"planSource":"MES","dayPlanID":"CRJH20200119-001","oid":"134"},{"planSource":"MES","dayPlanID":"CRJH20200117-028","oid":"133"},{"planSource":"MES","dayPlanID":"CRJH20200117-027","oid":"132"},{"planSource":"MES","dayPlanID":"CRJH20200117-026","oid":"131"},{"planSource":"MES","dayPlanID":"CRJH20200117-025","oid":"130"},{"planSource":"MES","dayPlanID":"CRJH20200117-024","oid":"129"},{"planSource":"MES","dayPlanID":"CRJH20200117-023","oid":"128"},{"planSource":"MES","dayPlanID":"CRJH20200117-022","oid":"127"},{"planSource":"MES","dayPlanID":"CRJH20200117-021","oid":"126"},{"planSource":"MES","dayPlanID":"CRJH20200117-020","oid":"125"},{"planSource":"MES","dayPlanID":"CRJH20200117-019","oid":"124"},{"planSource":"MES","dayPlanID":"CRJH20200117-018","oid":"123"},{"planSource":"MES","dayPlanID":"CRJH20200117-017","oid":"122"},{"planSource":"MES","dayPlanID":"CRJH20200117-016","oid":"121"},{"planSource":"MES","dayPlanID":"CRJH20200117-015","oid":"120"},{"planSource":"MES","dayPlanID":"CRJH20200117-014","oid":"119"},{"planSource":"MES","dayPlanID":"CRJH20200117-013","oid":"118"},{"planSource":"MES","dayPlanID":"CRJH20200117-012","oid":"117"},{"planSource":"MES","dayPlanID":"CRJH20200117-011","oid":"116"},{"planSource":"MES","dayPlanID":"CRJH20200117-010","oid":"115"},{"planSource":"MES","dayPlanID":"CRJH20200117-009","oid":"114"},{"planSource":"MES","dayPlanID":"CRJH20200117-008","oid":"113"},{"planSource":"MES","dayPlanID":"CRJH20200117-007","oid":"112"},{"planSource":"MES","dayPlanID":"CRJH20200117-006","oid":"111"},{"planSource":"MES","dayPlanID":"CRJH20200117-005","oid":"110"},{"planSource":"MES","dayPlanID":"CRJH20200117-004","oid":"109"},{"planSource":"MES","dayPlanID":"CRJH20200117-003","oid":"108"},{"planSource":"MES","dayPlanID":"CRJH20200117-002","oid":"107"},{"planSource":"MES","dayPlanID":"CRJH20200117-001","oid":"99"}]
     */

    private List<DataListBean> dataList;

    public List<DataListBean> getDataList() {
        return dataList;
    }

    public void setDataList(List<DataListBean> dataList) {
        this.dataList = dataList;
    }

    public static class DataListBean implements IPickerViewData {
        /**
         * planSource : MES
         * dayPlanID : CRJH20200121-010
         * oid : 159
         */

        private String planSource;//计划来源
        private String dayPlanID;//日计划单据号
        private String oid;//日计划oid/工序id/不良原因oid

        private String processID;//工序编号
        private String processContent;//工序描述


        private String badName;//不良名称

        public String getProcessID() {
            return processID;
        }

        public String getBadName() {
            return badName;
        }

        public String getProcessId() {
            return processID;
        }

        public String getProcessContent() {
            return processContent;
        }

        public String getPlanSource() {
            return planSource;
        }

        public void setPlanSource(String planSource) {
            this.planSource = planSource;
        }

        public String getDayPlanID() {
            return dayPlanID;
        }

        public void setDayPlanID(String dayPlanID) {
            this.dayPlanID = dayPlanID;
        }

        public String getOid() {
            return oid;
        }

        public void setOid(String oid) {
            this.oid = oid;
        }

        @Override
        public String toString() {
            return "DataListBean{" +
                    "planSource='" + planSource + '\'' +
                    ", dayPlanID='" + dayPlanID + '\'' +
                    ", oid='" + oid + '\'' +
                    ", processID='" + processID + '\'' +
                    ", processContent='" + processContent + '\'' +
                    '}';
        }

        @Override
        public String getPickerViewText() {
            if(!TextUtils.isEmpty(badName)){
                return badName;
            }
            return !TextUtils.isEmpty(dayPlanID)?dayPlanID:processContent;
        }
    }
}
